 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Threads
{
    
    class ThreadsClass
    {
        string name;
        int delay;
        public ThreadsClass(string aName,int delay)
        {
            name=aName;
            delay=delay;
            Thread t=new Thread(new ThreadStart(ThreadRunner));
            t.Start();
            Console.WriteLine("Thread {0} started",name);
        }
        public void ThreadRunner()
        {
            for(int i=0;i<5;i++)
            {
                Console.WriteLine("Thread {0} #{1}",name,i);
                Thread.Sleep(delay);
            }
            Console.WriteLine("Thread {0} is terminated", name);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            new ThreadsClass("T1", 100);
            new ThreadsClass("T2", 200);
            new ThreadsClass("T3", 300);
            new ThreadsClass("T4", 400);
            Console.ReadKey();
        }
    }
}
